Fixed bug with compressed dictionaries#160
Merged
Merged
Conversation
| std::string app_context = R"({"user_id": "test_user"})"; | ||
|
|
||
| EXPECT_NO_THROW(agent.init("test_column", connection_config, app_context, "test_key", | ||
| Type::BYTE_ARRAY, std::nullopt, CompressionCodec::SNAPPY, std::nullopt)); |
Collaborator
There was a problem hiding this comment.
Make this Type::Undefined otherwise if SNAPPY is supported in the future, the test will fail when decoding the BYTE_ARRAY
Collaborator
Author
There was a problem hiding this comment.
Why would the test fail in that case? I wanted to put in the test case that was actually failing. If I switch this to type Undefined and remove the Decompress line in the sequencer, this test would still pass.
Collaborator
Author
There was a problem hiding this comment.
Discussed offline, updated test data to be a correct BYTE_ARRAY, compressed using GZIP
| if (page_type == "DICTIONARY_PAGE") { | ||
| // TODO: Check whether dictionary pages can be compressed. | ||
| result.value_bytes = plaintext; | ||
| if (compression_ == CompressionCodec::UNCOMPRESSED) { |
Collaborator
There was a problem hiding this comment.
Decompress already handles the uncompressed case. It's best to just call it directly.
Updated test data
avalerio-tkd
approved these changes
Nov 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem found during canonical app development.
Dictionary pages can in fact be compressed, we were assuming they were not.
This caused problems with different data types, we observed INT64s being decoded wrong and BYTE_ARRAYS causing the server to crash when the length of the byte array did not match expectations.
Fixed by checking whether the dictionary is compressed or not and acting accordingly.